package cn.edu.zut.hhr.service.impl;

import cn.edu.zut.hhr.entity.Commodity;
import cn.edu.zut.hhr.mapper.CommodityMapper;
import cn.edu.zut.hhr.service.ICommodityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 商品表 服务实现类
 * </p>
 *
 * @author hhr
 * @since 2021-06-19
 */
@Service
public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity> implements ICommodityService {

    @Resource
    CommodityMapper commodityMapper;

    @Override
    public Commodity getCommodityById(Long id) {
        return commodityMapper.getCommodityById(id);
    }

    @Override
    public List<Commodity> getCommodityByName(String name) {
        return commodityMapper.getCommodityByName(name);
    }
}
